<?php

$code = new \Imagick( '/Volumes/kuozhan/zhengjian3.jpg');
$code->setimageformat('png');
$codePro = $code->getImageGeometry();
$codeWidth = $codePro['width'];
$codeHeight = $codePro['height'];

$codeLogo = new \Imagick( '/Volumes/kuozhan/zhengjian2.png' );
$codeLogo->thumbnailImage(100,100);
// $codeLogo->roundCorners( 300, 300 ); // radio 圆角处理
$code->compositeImage( $codeLogo, \imagick::COMPOSITE_DEFAULT , ( $codeWidth - 300)/2, ( $codeHeight - 300 )/2 );
$code->writeImage('/Volumes/kuozhan/zhengjian5.png');